package h0714;

import java.util.Arrays;
import java.util.Scanner;
/**
  * @description 猴子爬山，带缓存优化版本
  * @author 不知名帅哥
  * @date 2024/7/14 14:07
  * @version 1.0
*/
public class Main {
  static int[] cache = new int[51];

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();

    Arrays.fill(cache, -1);
    cache[0] = 0;
    cache[1] = 1;
    cache[2] = 1;
    cache[3] = 2;

    System.out.println(recursive(n));
  }

  public static int recursive(int n) {
    if (cache[n] != -1) return cache[n];
    cache[n] = recursive(n - 1) + recursive(n - 3);
    return cache[n];
  }
}